<?php

namespace common\models;

use Yii;

/**
 * This is the model class for table "{{%mails}}".
 *
 * @property string $id 编号，自增，主键
 * @property string $to_emails 目标邮箱地址
 * @property string $cc_emails 抄送邮箱地址
 * @property string $subject 邮件标题
 * @property string $html_body 邮件HTML内容
 * @property string $alt_body 邮件文本内容：如果HTML不能显示时显示这个
 * @property string $attach_files 附件文件地址
 * @property int $send_time 最后发送时间
 * @property int $send_status 发送状态：1,发送成功；2，发送失败
 * @property int $send_times 发送次数
 */
class Mails extends \yii\db\ActiveRecord
{
    /**
     * {@inheritdoc}
     */
    public static function tableName()
    {
        return '{{%mails}}';
    }

    /**
     * {@inheritdoc}
     */
    public function rules()
    {
        return [
            [['to_emails', 'cc_emails', 'html_body', 'alt_body', 'attach_files'], 'string'],
            [['send_time', 'send_status', 'send_times'], 'integer'],
            [['subject'], 'string', 'max' => 255],
        ];
    }

    /**
     * {@inheritdoc}
     */
    public function attributeLabels()
    {
        return [
            'id' => Yii::t('app', 'ID'),
            'to_emails' => Yii::t('app', 'To Emails'),
            'cc_emails' => Yii::t('app', 'Cc Emails'),
            'subject' => Yii::t('app', 'Subject'),
            'html_body' => Yii::t('app', 'Html Body'),
            'alt_body' => Yii::t('app', 'Alt Body'),
            'attach_files' => Yii::t('app', 'Attach Files'),
            'send_time' => Yii::t('app', 'Send Time'),
            'send_status' => Yii::t('app', 'Send Status'),
            'send_times' => Yii::t('app', 'Send Times'),
        ];
    }
}
